<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>forIn</title>
</head>
<body>


    <div>

        JavaScript for/in 语句遍历对象的属性：
        JavaScript for of 语句循环遍历可迭代对象的值。
    </div>

</body>

<script>

    var person = {fname:"Bill", lname:"Gates", age:62};

    var text = "";
    var x;
    for (x in person) {
        text += person[x];

    }
    console.log(text);


    const cars = ["BMW", "Volvo", "Mini"];
    text = "";
    for (let x of cars) {
        text += x;
    }
    console.log(text);



</script>
</html>
